//
//  TransactionNewsListCell.m
//  LianShangBao
//
//  Created by 主事丫环HU on 2020/9/8.
//  Copyright © 2020 主事丫环. All rights reserved.
//

#import "TransactionNewsListCell.h"
@interface TransactionNewsListCell()
@property (weak, nonatomic) IBOutlet UILabel *buyTypeLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *productNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *productTpyeLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *countLabel;
@property (weak, nonatomic) IBOutlet UILabel *totalPriceLabel;

@end
@implementation TransactionNewsListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
+ (instancetype)cellWithTableView:(UITableView *)tableView {
    
    static NSString *ID = @"TransactionNewsListCell";
    
    TransactionNewsListCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        
        cell = [NSBundle.mainBundle loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].firstObject;
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
- (void)setModel:(TransactionNewsListModel *)model{
    if ([model.payType isEqualToString:@"1"]) {
        self.buyTypeLabel.text = @"购买方式：余额支付";
    }else{
        self.buyTypeLabel.text = @"购买方式：积分兑换";
    }
    self.timeLabel.text = model.createDate;
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@""]];
    self.productNameLabel.text = model.name;
    self.productTpyeLabel.text = model.number;
    self.priceLabel.text = [NSString stringWithFormat:@"￥%@",model.price];
    self.countLabel.text = [NSString stringWithFormat:@"×%@",model.num];
    self.totalPriceLabel.text = [NSString stringWithFormat:@"总价：￥%@",model.allMoney];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
